<template>
  <div id="app">
    <template v-if="route.path.startsWith('/user')">
      <!-- router-view 是vue自带视图-->
      <router-view />
    </template>
    <template v-else>
      <BasicLayout />
    </template>
  </div>
</template>

<style>
#app {
}
</style>
<script setup lang="ts">
import BasicLayout from "@/layouts/BasicLayout.vue";
import { onMounted } from "vue";
import { useRoute } from "vue-router";

const route = useRoute();

/**
 * 全局初始化函数，有全局单次调用的代码，都可以写到这里
 */
const doInit = () => {
  console.log(
    "                           __                __                     .___       .__  __\n" +
      "                          |__|__ __  _______/  |_    ____  ____   __| _/____   |__|/  |_\n" +
      "                          |  |  |  \\/  ___/\\   __\\ _/ ___\\/  _ \\ / __ |/ __ \\  |  \\   __\\\n" +
      "                          |  |  |  /\\___ \\  |  |   \\  \\__(  <_> ) /_/ \\  ___/  |  ||  |\n" +
      "                      /\\__|  |____//____  > |__|    \\___  >____/\\____ |\\___  > |__||__|\n" +
      "                      \\______|          \\/              \\/           \\/    \\/\n"
  );
};

onMounted(() => {
  doInit();
});
</script>
